package com.nineshadow.games.Enum;

/**
 * 游戏结果
 */
public enum GameResultTypeEnum {
    LOSE(0, "输"),
    DRAW(1, "赢"),
    WIN(2, "平"),
    ;

    private final int code;
    private final String msg;

    GameResultTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static GameResultTypeEnum getByCode(int code) {
        for (GameResultTypeEnum anEnum : values()) {
            if (anEnum.code == code) {
                return anEnum;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
